package org.simplesocket.simplenettymtbatis.config;

public class DatasourceConfig {
    
    public static int connectionPoolInitSize;
    
    public static int connectionPoolMinSize;
    
    public static int connectionPoolMaxSize;
    
    public static long connectionPoolMaxWait;
    
    public static long connectionPoolCheckTimeInterval;
    
    public static long connectionPoolMinFreeTime;
    
    public static long connectionPoolMaxFreeTime;
    
    public static boolean connectionPoolKeepAlive;
    
    public static void setConfigValue(ConnectionPoolConfig config){
        DatasourceConfig.connectionPoolInitSize = config.getPoolInitSize();
        DatasourceConfig.connectionPoolMinSize = config.getPoolMinSize();
        DatasourceConfig.connectionPoolMaxSize = config.getPoolMaxSize();
        DatasourceConfig.connectionPoolMaxWait = config.getPoolMaxWait();
        DatasourceConfig.connectionPoolCheckTimeInterval = config.getPoolCheckTimeInterval();
        DatasourceConfig.connectionPoolMinFreeTime = config.getPoolMinFreeTime();
        DatasourceConfig.connectionPoolMaxFreeTime = config.getPoolMaxFreeTime();
        DatasourceConfig.connectionPoolKeepAlive = config.isPoolKeepAlive();
    }
    
}
